package com.bjsxt.homework4;

public class Test4 {

    public static void main(String[] args) {

        final SaleTicket st = new SaleTicket(30);
        /*for (int i = 0; i < 3; i++) {
            new Thread(new Runnable() {
                @Override
                public void run() {
                    st.sale();
                }
            }, "线程" + i).start();
        }*/

        new Thread(new Runnable() {
            @Override
            public void run() {
                st.sale1();
            }
        }, "线程1").start();


        new Thread(new Runnable() {
            @Override
            public void run() {
                st.sale2();
            }
        }, "线程2").start();

        new Thread(new Runnable() {
            @Override
            public void run() {
                st.sale3();
            }
        }, "线程3").start();
    }
}
